home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0391B.ZIP
/
JWINDOW.ARC
/
DIR.INC
next >
Wrap
Text File
|
1985-09-15
|
2KB
|
73 lines
{ Procedure dir.inc}
Procedure Dir;
Type
RegPack = record
AX,BX,CX,DX,BP,SI,DI,DS,ES,FLAGS : Integer
end;
Var Path : string[60];
Fcb, Dta :String[44]; {length for extended handle calls}
Regs : Regpack;
Filename : string[12];
I : byte;
Begin
clrscr;
Getdir (0,Path);
Writeln (' Current directory is ',path,#10#13);
Fcb := #255#0#0#0#0#0#0#0'????????????' ; {our command for the search }
{ put a bunch of nothing in the data transfer area }
Dta := ' ';
{ must let dos know where to put the information }
With Regs do
begin
DS := seg(Dta); {point to the segment}
DX := ofs(Dta)+1; { get the offset plus one, since first byte
contains length of string }
end;
{let dos set the transfer address }
With Regs do
begin
AX := $1A shl 8; { dos function to perform }
Msdos(Regs);
end;
{ now have to set the registers to the search fcb }
With Regs do
begin
DS := Seg(Fcb); {load the segment value}
DX := Ofs(Fcb)+1; { now the offset plus 1}
end;
{ to start the search must set msdos func. 11 }
With Regs do
begin
AX := $11 shl 8; { set dos function 11H}
end;
Msdos(Regs);
Write( ' ',copy (Dta,9,8),'.',copy (dta,17,3));
I := 2;
{ ----------- now set function in ah to 12h to continue ------ }
With Regs do
begin
AX := 4608; {you can use decimal set dos function 12H }
end;
While regs.AX = 4608 do {repeat till done }
begin
Msdos(regs);
filename := copy(Dta,9,8) + '.' + copy(Dta,17,3);
If I > 3 then
begin
write(#10,#13);
I := 1;
end;
Write (' ',filename);
I := I + 1;
end;
end;
{ end of small dir routine }